import request from '@/utils/request'

// 获取轨迹数据
export function selectCenterFromTaskIds(data) {
  return request({
    // url: '/routing/xunjian/task/selectCenterFromTaskIds', //不用了
    url: '/routing/xunjian/task/selectCenterFromTaskIds4PerceptionFrame',
    method: 'get',
    params: data
  })
}
// 全面测试,单目标通信感知测试 报告总评的小车走
export function selectCenterFromTaskIdAndType(query) {
  return request({
    url: '/routing/xunjian/task/selectCenterFromTaskIdAndType',
    method: 'get',
    params: query
  })
}
// 查询任务列表
export function listTask(query) {
  return request({
    url: '/routing/xunjian/task/list',
    method: 'get',
    params: query
  })
}

// 查询任务详细
export function getTask(taskId) {
  return request({
    url: '/routing/xunjian/task/' + taskId,
    method: 'get'
  })
}

// 新增任务
export function addTask(data) {
  return request({
    url: '/routing/xunjian/task',
    method: 'post',
    data: data
  })
}

// 修改任务
export function updateTask(data) {
  return request({
    url: '/routing/xunjian/task',
    method: 'put',
    data: data
  })
}

// 删除任务
export function delTask(taskId) {
  return request({
    url: '/routing/xunjian/task/' + taskId,
    method: 'delete'
  })
}

// 识别经纬度
export function identify(data) {
  return request({
    url: '/routing/xunjian/point/identify',
    method: 'post',
    data: data
  })
}

// 查询测试报告分数
export function getInfoByTaskId(taskId) {
  return request({
    url: '/routing/xunjian/report/getInfoByTaskId?taskId=' + taskId,
    method: 'get',
  })
}

export function getIndexByTaskId() {
  return request({
    url: '/routing/xunjian/report/getIndexByTaskId',
    method: 'get',
  })
}
export function getPerceptionByTaskId() {
  return request({
    url: '/routing/xunjian/report/getPerceptionByTaskId',
    method: 'get',
  })
}

// 通信折线图
export function getIndicators(size) {
  return request({
    url: '/routing/xunjian/task/getIndicators?size=' + size,
    method: 'get',
  })
}
// 感知折线图
export function getPerception(size) {
  return request({
    url: '/routing/xunjian/task/getPerception?size=' + size,
    method: 'get',
  })
}

// 热力图
export function getHeatMapData(query) {
  return request({
    url: '/routing/xunjian/task/getHeatMapData',
    method: 'get',
    params: query
  })
}

export function IndexStatistics(taskId) {
  return request({
    url: '/routing/xunjian/task/IndexStatistics?taskId=' + taskId,
    method: 'get',
  })
}
//添加测试 列表的点位
export function pointListAll() {
  return request({
    url: '/routing/xunjian/point/listAll',
    method: 'get',
  })
}



// 全面测试提交
export function stepSubmit(data) {
  return request({
    url: '/routing/xunjian/step/edit',
    method: 'post',
    data: data
  })
}



// /xunjian/task/singleGetHeatMapData

// 全面测试单目标热力图
export function singleGetHeatMapData(query) {
  return request({
    url: '/routing/xunjian/task/singleGetHeatMapData',
    method: 'get',
    params: query
  })
}

// 真值文件上传
export function importMaintenance(data) {
  return request({
    url: '/routing/xunjian/task/data/importMaintenance?taskId=' + data.taskId,
    method: 'post',
    data: data,
  })
}


// 真值的总帧数和开始结束时间
export function getMaintenance(data) {
  return request({
    url: '/routing/xunjian/task/data/getMaintenance',
    method: 'post',
    // data: data,
    params: data
  })
}
// 参数 taskId 任务id   返回中的totals是总帧数，startTime是开始时间，endtime是结束时间

// post请求，参数taskId 任务id  startTime 毫秒级时间戳，size，需要返回的帧数
// 真值的需要返回的帧数
export function getMaintenanceByTaskId(data) {
  return request({
    url: '/routing/xunjian/task/data/getMaintenanceByTaskId',
    method: 'post',
    // data: data,
    params: data
  })
}

//带测值  返回 totals 总帧数 startTime开始时间  endTime 结束时间
export function getTestMaintenanceByTaskId(data) {
  return request({
    url: '/routing/xunjian/task/data/getTestMaintenanceByTaskId',
    method: 'post',
    // data: data,
    params: data
  })
}

//带测值  返回 startTime 开始时间 和数据
export function getTestMaintenanceByTaskIdSize(data) {
  return request({
    url: '/routing/xunjian/task/data/getTestMaintenanceByTaskIdSize',
    method: 'post',
    // data: data,
    params: data
  })
}

// 单目标通信感知测试
export function singleIndexStatistics(query) {
  return request({
    url: '/routing/xunjian/task/singleIndexStatistics',
    method: 'get',
    params: query
  })
}

//获取真值的分析结果
export function getMultiPackageReportByTaskId(query) {
  return request({
    url: '/routing/multi/multiReport/getMultiPackageReportByTaskId',
    method: 'get',
    params: query
  })
}

//开始分析
export function sendMultiPackage(query) {
  return request({
    url: '/routing/multi/package/sendMultiPackage',
    method: 'get',
    params: query
  })
}

//获取分析状态
export function getMultiPackageStatus(query) {
  return request({
    url: '/routing/multi/package/getMultiPackageStatus',
    method: 'get',
    params: query
  })
}

// 获取多目标分析结果
export function getMultiPackageReportDetailsByTask(query) {
  return request({
    url: '/routing/multi/multiReport/getMultiPackageReportDetailsByTask',
    method: 'get',
    params: query
  })
}
//导出待测值
export function downloadMultiPointFrame(query) {
  return request({
    url: '/multi/package/downloadMultiPointFrame',
    method: 'get',
    params: query
  })
}

export function analyzeImage(query) {
  return request({
    url: '/routing/xunjian/report/analyzeImage',
    method: 'get',
    params: query
  })
}
export function upload(data) {
  return request({
    url: '/file/upload',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data: data
  })
}

// 获取数据
export function getPoint() {
  return request({
    url: '/routing/xunjian/point/listAll',
    method: 'get'
  })
}

//下载报告给
export function downloadPdf(query) {
  return request({
    url: '/routing/xunjian/report/downloadPdf',
    method: 'post',
    params: query
  })
}
// 11:32

// 全面测试结束任务
export function closeTaskAll(data) {
  return request({
    url: '/routing/xunjian/task/closeTaskAll',
    method: 'get',
    params:data
  })
}
//点位轨迹
export function getPointFrame(data) {
  return request({
    url: '/routing/xunjian/task/selectPointPerceptionFramesByTaskId',
    method: 'get',
    params:data
  })
}

//车辆轨迹
export function selectDevicePerceptionFramesByTaskId(data) {
  return request({
    url: '/routing/xunjian/task/selectDevicePerceptionFramesByTaskId',
    method: 'get',
    params:data
  })
}
//数据管理（设备列表）
export function selectDeviceList() {
  return request({
    url: '/routing/xunjian/device/selectDeviceList',
    method: 'get',
  })
}
// 数据管理（预约下载列表）
export function downloadList(data) {
  return request({
    url: '/reports/data/download/list',
    method: 'get',
    params: data
  })
}
// 数据管理（预约下载）
export function downloadAdd(data) {
  return request({
    url: '/reports/data/download/add',
    method: 'post',
    data: data
  })
}
// 数据管理（下载导出）
export function downloadExport(query) {
  return request({
    url: '/reports/data/download/export',
    method: 'post',
    params: query
  })
}

